#include "IdentDTD.h"
#include <iostream>

using namespace std;

IdentDTD::IdentDTD(const char *_name, Card _card) : name(_name), card(_card)
{
}

string IdentDTD::getName() const
{
    return name;
}

void IdentDTD::display() const
{
    std::cout<<name;
    if(card == ONE_N)
        printf("+");
    else if(card == ZERO_N)
        printf("*");
    else if(card == ZERO_ONE)
        printf("?");
}


string IdentDTD::regExpCreate() const
{
    string regExp = "(<" + name + ")";

    /* adding the cardinality */
    /* adding the cardinality */
    if(card == ONE_N)
        regExp += "+";
    else if(card == ZERO_N)
        regExp += "*";
    else if(card == ZERO_ONE)
        regExp += "?";

    return regExp;
}
